home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / calzip / calform.frm (.txt) next >
Encoding:
Visual Basic Form  |  1995-05-08  |  22.8 KB  |  727 lines

  1. VERSION 2.00
  2. Begin Form calform 
  3.    BackColor       =   &H00000040&
  4.    Caption         =   "calender program"
  5.    ClientHeight    =   5700
  6.    ClientLeft      =   450
  7.    ClientTop       =   1335
  8.    ClientWidth     =   7425
  9.    FontBold        =   -1  'True
  10.    FontItalic      =   0   'False
  11.    FontName        =   "MS Sans Serif"
  12.    FontSize        =   13.5
  13.    FontStrikethru  =   0   'False
  14.    FontUnderline   =   0   'False
  15.    Height          =   6105
  16.    Left            =   390
  17.    LinkMode        =   1  'Source
  18.    LinkTopic       =   "Form1"
  19.    ScaleHeight     =   5700
  20.    ScaleWidth      =   7425
  21.    Top             =   990
  22.    Width           =   7545
  23.    Begin Timer Timer1 
  24.       Enabled         =   0   'False
  25.       Interval        =   1
  26.       Left            =   6240
  27.       Top             =   5280
  28.    End
  29.    Begin CommandButton Command2 
  30.       Caption         =   "A&bout"
  31.       Height          =   495
  32.       Left            =   5280
  33.       TabIndex        =   59
  34.       Top             =   5160
  35.       Width           =   735
  36.    End
  37.    Begin TextBox YearEntered 
  38.       Height          =   375
  39.       Left            =   1680
  40.       TabIndex        =   6
  41.       Top             =   5160
  42.       Width           =   1215
  43.    End
  44.    Begin CommandButton Command1 
  45.       Caption         =   "&December"
  46.       Height          =   375
  47.       Index           =   11
  48.       Left            =   6120
  49.       TabIndex        =   17
  50.       Top             =   4680
  51.       Width           =   1095
  52.    End
  53.    Begin CommandButton Command1 
  54.       Caption         =   "&November"
  55.       Height          =   375
  56.       Index           =   10
  57.       Left            =   4920
  58.       TabIndex        =   16
  59.       Top             =   4680
  60.       Width           =   1095
  61.    End
  62.    Begin CommandButton Command1 
  63.       Caption         =   "&October"
  64.       Height          =   375
  65.       Index           =   9
  66.       Left            =   3720
  67.       TabIndex        =   15
  68.       Top             =   4680
  69.       Width           =   1095
  70.    End
  71.    Begin CommandButton Command1 
  72.       Caption         =   "&September"
  73.       Height          =   375
  74.       Index           =   8
  75.       Left            =   2520
  76.       TabIndex        =   14
  77.       Top             =   4680
  78.       Width           =   1095
  79.    End
  80.    Begin CommandButton Command1 
  81.       Caption         =   "Augus&t"
  82.       Height          =   375
  83.       Index           =   7
  84.       Left            =   1320
  85.       TabIndex        =   13
  86.       Top             =   4680
  87.       Width           =   1095
  88.    End
  89.    Begin CommandButton Command1 
  90.       Caption         =   "Jul&y"
  91.       Height          =   375
  92.       Index           =   6
  93.       Left            =   120
  94.       TabIndex        =   12
  95.       Top             =   4680
  96.       Width           =   1095
  97.    End
  98.    Begin CommandButton Command1 
  99.       Caption         =   "Jun&e"
  100.       Height          =   375
  101.       Index           =   5
  102.       Left            =   6120
  103.       TabIndex        =   11
  104.       Top             =   4200
  105.       Width           =   1095
  106.    End
  107.    Begin CommandButton Command1 
  108.       Caption         =   "Ma&y"
  109.       Height          =   375
  110.       Index           =   4
  111.       Left            =   4920
  112.       TabIndex        =   10
  113.       Top             =   4200
  114.       Width           =   1095
  115.    End
  116.    Begin CommandButton Command1 
  117.       Caption         =   "&April"
  118.       Height          =   375
  119.       Index           =   3
  120.       Left            =   3720
  121.       TabIndex        =   9
  122.       Top             =   4200
  123.       Width           =   1095
  124.    End
  125.    Begin CommandButton Command1 
  126.       Caption         =   "&March"
  127.       Height          =   375
  128.       Index           =   2
  129.       Left            =   2520
  130.       TabIndex        =   8
  131.       Top             =   4200
  132.       Width           =   1095
  133.    End
  134.    Begin CommandButton Command1 
  135.       Caption         =   "&February"
  136.       Height          =   375
  137.       Index           =   1
  138.       Left            =   1320
  139.       TabIndex        =   4
  140.       Top             =   4200
  141.       Width           =   1095
  142.    End
  143.    Begin CommandButton Command1 
  144.       Caption         =   "&January"
  145.       Height          =   375
  146.       Index           =   0
  147.       Left            =   120
  148.       TabIndex        =   3
  149.       Top             =   4200
  150.       Width           =   1095
  151.    End
  152.    Begin Frame Frame1 
  153.       BackColor       =   &H0080FFFF&
  154.       Height          =   3975
  155.       Left            =   240
  156.       TabIndex        =   0
  157.       Top             =   120
  158.       Width           =   6015
  159.       Begin Label Label1 
  160.          BackColor       =   &H00C0C0C0&
  161.          BorderStyle     =   1  'Fixed Single
  162.          Caption         =   "Label1"
  163.          Height          =   495
  164.          Index           =   41
  165.          Left            =   5160
  166.          TabIndex        =   58
  167.          Top             =   3360
  168.          Width           =   855
  169.       End
  170.       Begin Label Label1 
  171.          BorderStyle     =   1  'Fixed Single
  172.          Caption         =   "Label1"
  173.          Height          =   495
  174.          Index           =   40
  175.          Left            =   4320
  176.          TabIndex        =   57
  177.          Top             =   3360
  178.          Width           =   855
  179.       End
  180.       Begin Label Label1 
  181.          BorderStyle     =   1  'Fixed Single
  182.          Caption         =   "Label1"
  183.          Height          =   495
  184.          Index           =   39
  185.          Left            =   3360
  186.          TabIndex        =   56
  187.          Top             =   3360
  188.          Width           =   975
  189.       End
  190.       Begin Label Label1 
  191.          BorderStyle     =   1  'Fixed Single
  192.          Caption         =   "Label1"
  193.          Height          =   495
  194.          Index           =   38
  195.          Left            =   2400
  196.          TabIndex        =   55
  197.          Top             =   3360
  198.          Width           =   975
  199.       End
  200.       Begin Label Label1 
  201.          BorderStyle     =   1  'Fixed Single
  202.          Caption         =   "Label1"
  203.          Height          =   495
  204.          Index           =   37
  205.          Left            =   1560
  206.          TabIndex        =   54
  207.          Top             =   3360
  208.          Width           =   855
  209.       End
  210.       Begin Label Label1 
  211.          BorderStyle     =   1  'Fixed Single
  212.          Caption         =   "Label1"
  213.          Height          =   495
  214.          Index           =   36
  215.          Left            =   720
  216.          TabIndex        =   53
  217.          Top             =   3360
  218.          Width           =   855
  219.       End
  220.       Begin Label Label1 
  221.          BackColor       =   &H00C0C0C0&
  222.          BorderStyle     =   1  'Fixed Single
  223.          Caption         =   "Label1"
  224.          Height          =   495
  225.          Index           =   35
  226.          Left            =   0
  227.          TabIndex        =   52
  228.          Top             =   3360
  229.          Width           =   735
  230.       End
  231.       Begin Label Label1 
  232.          BackColor       =   &H00C0C0C0&
  233.          BorderStyle     =   1  'Fixed Single
  234.          Caption         =   "Label1"
  235.          Height          =   495
  236.          Index           =   34
  237.          Left            =   5160
  238.          TabIndex        =   50
  239.          Top             =   2880
  240.          Width           =   855
  241.       End
  242.       Begin Label Label1 
  243.          BorderStyle     =   1  'Fixed Single
  244.          Caption         =   "Label1"
  245.          Height          =   495
  246.          Index           =   33
  247.          Left            =   4320
  248.          TabIndex        =   49
  249.          Top             =   2880
  250.          Width           =   855
  251.       End
  252.       Begin Label Label1 
  253.          BorderStyle     =   1  'Fixed Single
  254.          Caption         =   "Label1"
  255.          Height          =   495
  256.          Index           =   32
  257.          Left            =   3360
  258.          TabIndex        =   48
  259.          Top             =   2880
  260.          Width           =   975
  261.       End
  262.       Begin Label Label1 
  263.          BorderStyle     =   1  'Fixed Single
  264.          Caption         =   "Label1"
  265.          Height          =   495
  266.          Index           =   31
  267.          Left            =   2400
  268.          TabIndex        =   47
  269.          Top             =   2880
  270.          Width           =   975
  271.       End
  272.       Begin Label Label1 
  273.          BorderStyle     =   1  'Fixed Single
  274.          Caption         =   "Label1"
  275.          Height          =   495
  276.          Index           =   30
  277.          Left            =   1560
  278.          TabIndex        =   46
  279.          Top             =   2880
  280.          Width           =   855
  281.       End
  282.       Begin Label Label1 
  283.          BorderStyle     =   1  'Fixed Single
  284.          Caption         =   "Label1"
  285.          Height          =   495
  286.          Index           =   29
  287.          Left            =   720
  288.          TabIndex        =   45
  289.          Top             =   2880
  290.          Width           =   855
  291.       End
  292.       Begin Label Label1 
  293.          BackColor       =   &H00C0C0C0&
  294.          BorderStyle     =   1  'Fixed Single
  295.          Caption         =   "Label1"
  296.          Height          =   495
  297.          Index           =   28
  298.          Left            =   0
  299.          TabIndex        =   44
  300.          Top             =   2880
  301.          Width           =   735
  302.       End
  303.       Begin Label Label1 
  304.          BackColor       =   &H00C0C0C0&
  305.          BorderStyle     =   1  'Fixed Single
  306.          Caption         =   "Label1"
  307.          Height          =   495
  308.          Index           =   27
  309.          Left            =   5160
  310.          TabIndex        =   43
  311.          Top             =   2400
  312.          Width           =   855
  313.       End
  314.       Begin Label Label1 
  315.          BorderStyle     =   1  'Fixed Single
  316.          Caption         =   "Label1"
  317.          Height          =   495
  318.          Index           =   26
  319.          Left            =   4320
  320.          TabIndex        =   42
  321.          Top             =   2400
  322.          Width           =   855
  323.       End
  324.       Begin Label Label1 
  325.          BorderStyle     =   1  'Fixed Single
  326.          Caption         =   "Label1"
  327.          Height          =   495
  328.          Index           =   25
  329.          Left            =   3360
  330.          TabIndex        =   41
  331.          Top             =   2400
  332.          Width           =   975
  333.       End
  334.       Begin Label Label1 
  335.          BorderStyle     =   1  'Fixed Single
  336.          Caption         =   "Label1"
  337.          Height          =   495
  338.          Index           =   24
  339.          Left            =   2400
  340.          TabIndex        =   40
  341.          Top             =   2400
  342.          Width           =   975
  343.       End
  344.       Begin Label Label1 
  345.          BorderStyle     =   1  'Fixed Single
  346.          Caption         =   "Label1"
  347.          Height          =   495
  348.          Index           =   23
  349.          Left            =   1560
  350.          TabIndex        =   39
  351.          Top             =   2400
  352.          Width           =   855
  353.       End
  354.       Begin Label Label1 
  355.          BorderStyle     =   1  'Fixed Single
  356.          Caption         =   "Label1"
  357.          Height          =   495
  358.          Index           =   22
  359.          Left            =   720
  360.          TabIndex        =   38
  361.          Top             =   2400
  362.          Width           =   855
  363.       End
  364.       Begin Label Label1 
  365.          BackColor       =   &H00C0C0C0&
  366.          BorderStyle     =   1  'Fixed Single
  367.          Caption         =   "Label1"
  368.          Height          =   495
  369.          Index           =   21
  370.          Left            =   0
  371.          TabIndex        =   37
  372.          Top             =   2400
  373.          Width           =   735
  374.       End
  375.       Begin Label Label1 
  376.          BackColor       =   &H00C0C0C0&
  377.          BorderStyle     =   1  'Fixed Single
  378.          Caption         =   "Label1"
  379.          Height          =   495
  380.          Index           =   20
  381.          Left            =   5160
  382.          TabIndex        =   36
  383.          Top             =   1920
  384.          Width           =   855
  385.       End
  386.       Begin Label Label1 
  387.          BorderStyle     =   1  'Fixed Single
  388.          Caption         =   "Label1"
  389.          Height          =   495
  390.          Index           =   19
  391.          Left            =   4320
  392.          TabIndex        =   35
  393.          Top             =   1920
  394.          Width           =   855
  395.       End
  396.       Begin Label Label1 
  397.          BorderStyle     =   1  'Fixed Single
  398.          Caption         =   "Label1"
  399.          Height          =   495
  400.          Index           =   18
  401.          Left            =   3360
  402.          TabIndex        =   34
  403.          Top             =   1920
  404.          Width           =   975
  405.       End
  406.       Begin Label Label1 
  407.          BorderStyle     =   1  'Fixed Single
  408.          Caption         =   "Label1"
  409.          Height          =   495
  410.          Index           =   17
  411.          Left            =   2400
  412.          TabIndex        =   33
  413.          Top             =   1920
  414.          Width           =   975
  415.       End
  416.       Begin Label Label1 
  417.          BorderStyle     =   1  'Fixed Single
  418.          Caption         =   "Label1"
  419.          Height          =   495
  420.          Index           =   16
  421.          Left            =   1560
  422.          TabIndex        =   32
  423.          Top             =   1920
  424.          Width           =   855
  425.       End
  426.       Begin Label Label1 
  427.          BorderStyle     =   1  'Fixed Single
  428.          Caption         =   "Label1"
  429.          Height          =   495
  430.          Index           =   15
  431.          Left            =   720
  432.          TabIndex        =   31
  433.          Top             =   1920
  434.          Width           =   855
  435.       End
  436.       Begin Label Label1 
  437.          BackColor       =   &H00C0C0C0&
  438.          BorderStyle     =   1  'Fixed Single
  439.          Caption         =   "Label1"
  440.          Height          =   495
  441.          Index           =   14
  442.          Left            =   0
  443.          TabIndex        =   30
  444.          Top             =   1920
  445.          Width           =   735
  446.       End
  447.       Begin Label Label1 
  448.          BackColor       =   &H00C0C0C0&
  449.          BorderStyle     =   1  'Fixed Single
  450.          Caption         =   "Label1"
  451.          Height          =   495
  452.          Index           =   13
  453.          Left            =   5160
  454.          TabIndex        =   29
  455.          Top             =   1440
  456.          Width           =   855
  457.       End
  458.       Begin Label Label1 
  459.          BorderStyle     =   1  'Fixed Single
  460.          Caption         =   "Label1"
  461.          Height          =   495
  462.          Index           =   12
  463.          Left            =   4320
  464.          TabIndex        =   28
  465.          Top             =   1440
  466.          Width           =   855
  467.       End
  468.       Begin Label Label1 
  469.          BorderStyle     =   1  'Fixed Single
  470.          Caption         =   "Label1"
  471.          Height          =   495
  472.          Index           =   11
  473.          Left            =   3360
  474.          TabIndex        =   27
  475.          Top             =   1440
  476.          Width           =   975
  477.       End
  478.       Begin Label Label1 
  479.          BorderStyle     =   1  'Fixed Single
  480.          Caption         =   "Label1"
  481.          Height          =   495
  482.          Index           =   10
  483.          Left            =   2400
  484.          TabIndex        =   26
  485.          Top             =   1440
  486.          Width           =   975
  487.       End
  488.       Begin Label Label1 
  489.          BorderStyle     =   1  'Fixed Single
  490.          Caption         =   "Label1"
  491.          Height          =   495
  492.          Index           =   9
  493.          Left            =   1560
  494.          TabIndex        =   25
  495.          Top             =   1440
  496.          Width           =   855
  497.       End
  498.       Begin Label Label1 
  499.          BorderStyle     =   1  'Fixed Single
  500.          Caption         =   "Label1"
  501.          Height          =   495
  502.          Index           =   8
  503.          Left            =   720
  504.          TabIndex        =   24
  505.          Top             =   1440
  506.          Width           =   855
  507.       End
  508.       Begin Label Label1 
  509.          BackColor       =   &H00C0C0C0&
  510.          BorderStyle     =   1  'Fixed Single
  511.          Caption         =   "Label1"
  512.          Height          =   495
  513.          Index           =   7
  514.          Left            =   0
  515.          TabIndex        =   23
  516.          Top             =   1440
  517.          Width           =   735
  518.       End
  519.       Begin Label Label1 
  520.          BackColor       =   &H00C0C0C0&
  521.          BorderStyle     =   1  'Fixed Single
  522.          Caption         =   "Label1"
  523.          Height          =   495
  524.          Index           =   6
  525.          Left            =   5160
  526.          TabIndex        =   22
  527.          Top             =   960
  528.          Width           =   855
  529.       End
  530.       Begin Label Label1 
  531.          BorderStyle     =   1  'Fixed Single
  532.          Caption         =   "Label1"
  533.          Height          =   495
  534.          Index           =   5
  535.          Left            =   4320
  536.          TabIndex        =   21
  537.          Top             =   960
  538.          Width           =   855
  539.       End
  540.       Begin Label Label1 
  541.          BorderStyle     =   1  'Fixed Single
  542.          Caption         =   "Label1"
  543.          Height          =   495
  544.          Index           =   4
  545.          Left            =   3360
  546.          TabIndex        =   20
  547.          Top             =   960
  548.          Width           =   975
  549.       End
  550.       Begin Label Label1 
  551.          BorderStyle     =   1  'Fixed Single
  552.          Caption         =   "Label1"
  553.          Height          =   495
  554.          Index           =   3
  555.          Left            =   2400
  556.          TabIndex        =   19
  557.          Top             =   960
  558.          Width           =   975
  559.       End
  560.       Begin Label Label1 
  561.          Alignment       =   2  'Center
  562.          BorderStyle     =   1  'Fixed Single
  563.          Caption         =   "Label1"
  564.          Height          =   495
  565.          Index           =   2
  566.          Left            =   1560
  567.          TabIndex        =   18
  568.          Top             =   960
  569.          Width           =   855
  570.       End
  571.       Begin Label Label1 
  572.          Alignment       =   2  'Center
  573.          BorderStyle     =   1  'Fixed Single
  574.          Caption         =   "Label1"
  575.          Height          =   495
  576.          Index           =   1
  577.          Left            =   720
  578.          TabIndex        =   2
  579.          Top             =   960
  580.          Width           =   855
  581.       End
  582.       Begin Label Label1 
  583.          Alignment       =   2  'Center
  584.          BackColor       =   &H00C0C0C0&
  585.          BorderStyle     =   1  'Fixed Single
  586.          Caption         =   "Label1"
  587.          FontBold        =   -1  'True
  588.          FontItalic      =   0   'False
  589.          FontName        =   "MS Sans Serif"
  590.          FontSize        =   9.75
  591.          FontStrikethru  =   0   'False
  592.          FontUnderline   =   0   'False
  593.          Height          =   495
  594.          Index           =   0
  595.          Left            =   0
  596.          TabIndex        =   1
  597.          Top             =   960
  598.          Width           =   735
  599.       End
  600.       Begin Label Label2 
  601.          BorderStyle     =   1  'Fixed Single
  602.          Caption         =   "  Sun   Mon    Tue     Wed      Thur     Fri       Sat"
  603.          FontBold        =   -1  'True
  604.          FontItalic      =   0   'False
  605.          FontName        =   "MS Sans Serif"
  606.          FontSize        =   12
  607.          FontStrikethru  =   0   'False
  608.          FontUnderline   =   0   'False
  609.          Height          =   375
  610.          Left            =   0
  611.          TabIndex        =   5
  612.          Top             =   480
  613.          Width           =   6015
  614.       End
  615.       Begin Label monthLabel 
  616.          Alignment       =   2  'Center
  617.          BackColor       =   &H0000FFFF&
  618.          BorderStyle     =   1  'Fixed Single
  619.          Caption         =   "Month"
  620.          FontBold        =   -1  'True
  621.          FontItalic      =   0   'False
  622.          FontName        =   "MS Sans Serif"
  623.          FontSize        =   13.5
  624.          FontStrikethru  =   0   'False
  625.          FontUnderline   =   0   'False
  626.          Height          =   375
  627.          Left            =   1920
  628.          TabIndex        =   51
  629.          Top             =   120
  630.          Width           =   2055
  631.       End
  632.    End
  633.    Begin Label Label3 
  634.       BorderStyle     =   1  'Fixed Single
  635.       Caption         =   "Year Desired"
  636.       Height          =   375
  637.       Left            =   120
  638.       TabIndex        =   7
  639.       Top             =   5160
  640.       Width           =   1335
  641.    End
  642.    Dim True As Integer
  643.    Dim false As Integer
  644.    Dim currentmonth As Integer
  645. Sub Command1_Click (index As Integer)
  646.     currentmonth = index
  647.     Select Case Val(yearentered.Text)
  648.            Case Is < 1900, Is > 2100
  649.              MsgBox ("Day Out Of Range: ") + yearentered.Text
  650.              yearentered.SetFocus
  651.              Exit Sub
  652.     End Select
  653.     Select Case index
  654.            Case 0 To 11
  655.                  X% = index + 1
  656.                  RelVal# = DateSerial(1990, X%, 1)
  657.                  monthlabel.caption = Format$(RelVal#, "mmmm")
  658.            Case Else
  659.                  monthlabel.caption = (" ")
  660.      End Select
  661.      RelVal# = DateSerial(Val(yearentered.Text), X%, 1)
  662.      Select Case index
  663.          
  664.         Case 0, 2, 4, 6, 7, 9, 11
  665.              NumbDays% = 31
  666.              GoSub LoadDays
  667.         Case 1
  668.              TheYear% = Val(yearentered.Text)
  669.              By4% = TheYear% Mod 4
  670.              If By4% = 0 Then
  671.                 NumbDays% = 29
  672.              Else
  673.                 NumbDays% = 28
  674.              End If
  675.              GoSub LoadDays
  676.         Case 3, 5, 8, 10
  677.              NumbDays% = 31
  678.              GoSub LoadDays
  679.          
  680.         Case Else
  681.              MsgBox ("Please Select Month")
  682.     End Select
  683.     Exit Sub
  684. LoadDays:
  685.     DayNumber% = Weekday(RelVal#)
  686.     xxxx = 0
  687.     Z% = 0
  688.     For xx% = 0 To 41
  689.         Label1(xx%).caption = ""
  690.     Next xx%
  691.     For xx% = (DayNumber% - 1) To (NumbDays% + DayNumber% - 2)
  692.        Z% = Z% + 1
  693.        Label1(xx%).caption = Str$(Z%)
  694.     Next xx%
  695.     Return
  696. End Sub
  697. Sub Command2_Click ()
  698.     Text$ = "Use this as you see fit.  The code is yours.      If it saves you an hour of coding, "
  699.     Text$ = Text$ + " then send me the value of 1/4 hour of your time.        Send contributions to"
  700.     Text$ = Text$ + " Al Meadows  c/o Andrews Davis Law Firm, 500 West Main, Oklahoma City, Ok. 73102"
  701.     MsgBox Text$
  702. End Sub
  703. Sub Form_Load ()
  704.     CalForm.Left = 1275
  705.     CalForm.Top = 765
  706.     Frame1.Left = (ScaleWidth - Frame1.Width) / 2
  707.     True = -1
  708.     false = 0
  709.     For I% = 0 To 41
  710.     currentmonth = 13
  711.         Label1(I%).alignment = 2
  712.         Label1(I%).caption = ""
  713.         Label1(I%).fontsize = 9.75
  714.     Next I%
  715.     Timer1.enabled = True
  716. End Sub
  717. Sub timer1_timer ()
  718.     yearentered.SetFocus
  719.     Timer1.enabled = False
  720. End Sub
  721. Sub YearEntered_KeyPress (keyascii As Integer)
  722.     Select Case keyascii
  723.            Case 13
  724.               Command1_Click (currentmonth)
  725.     End Select
  726. End Sub
  727.